/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow: hidden;
    height: 100vh;
}

/* 加载界面 */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-text {
    margin-top: 10px;
    opacity: 0.8;
}

/* 加载进度条 */
.loading-progress {
    width: 300px;
    max-width: 80%;
    margin: 20px auto 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007AFF, #5AC8FA);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    color: white;
    font-size: 12px;
    font-weight: 500;
}

.progress-percentage {
    font-weight: 600;
}

.progress-task {
    opacity: 0.8;
}

/* 主容器 */
#main-container {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* WebXR 按钮容器 */
#vr-button-container {
    position: fixed;
    bottom: 50px;
    right: 50px;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* WebXR 按钮样式增强 */
#vr-button-container button {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    cursor: pointer;
    user-select: none;
    outline: none;
    border: none;
    min-width: 120px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Vision Pro 特定样式 */
@media (min-width: 3840px) {
    #vr-button-container {
        bottom: 60px;
        right: 60px;
    }
    
    #vr-button-container button {
        font-size: 18px !important;
        padding: 16px 32px !important;
        border-radius: 20px !important;
    }
}

/* 移动设备样式 */
@media (max-width: 768px) {
    #vr-button-container {
        bottom: 40px;
        right: 40px;
    }
    
    #vr-button-container button {
        font-size: 14px;
        padding: 10px 20px;
        min-width: 100px;
    }
}

/* 控制面板 */
#control-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 350px;
    max-height: calc(100vh - 40px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 50;
    transition: transform 0.3s ease;
}



.toggle-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.panel-content {
    padding: 20px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* 对话历史 */
#chat-history {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.welcome-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.message {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
}

.message.user {
    background: #007AFF;
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.ai {
    background: #F2F2F7;
    color: #333;
    margin-right: auto;
}

.message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
}

/* 输入区域 */
#input-area {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

#text-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.2s, box-shadow 0.2s;
}

#text-input:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.action-btn {
    padding: 12px 20px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.action-btn:hover {
    background: #0056CC;
}

.action-btn:active {
    transform: scale(0.98);
}

.action-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 语音控制 */
.voice-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.voice-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #34C759;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.voice-btn:hover {
    background: #28A745;
}

.voice-btn:active {
    transform: scale(0.98);
}

.voice-btn.recording {
    background: #FF3B30;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.voice-status {
    font-size: 12px;
    color: #666;
}

/* 设置区域 */
#settings-area {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 16px;
    margin-top: 16px;
}

.setting-group {
    margin-bottom: 12px;
}

.setting-group label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* 状态指示器 */
#status-indicator {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 12px;
    z-index: 40;
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-label {
    margin-right: 12px;
}

.status-value {
    font-weight: 500;
}

.status-value.connected {
    color: #34C759;
}

.status-value.disconnected {
    color: #FF3B30;
}

.status-value.thinking {
    color: #FF9500;
}

/* 字幕显示 */
#subtitles {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white !important;
    padding: 15px 25px;
    border-radius: 15px;
    font-size: 20px;
    font-weight: 500;
    max-width: 75%;
    min-height: 60px;
    text-align: center;
    z-index: 30;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 字幕文本元素样式 */
#subtitle-text {
    color: inherit !important;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    text-align: center;
    word-wrap: break-word;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#subtitles.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* 实时字幕动画效果 */
#subtitles.realtime {
    animation: subtitlePulse 0.1s ease-in-out;
}

@keyframes subtitlePulse {
    0% { transform: translateX(-50%) translateY(-5px) scale(1); }
    50% { transform: translateX(-50%) translateY(-5px) scale(1.01); }
    100% { transform: translateX(-50%) translateY(-5px) scale(1); }
}

/* 响应式字幕 */
@media (max-width: 768px) {
    #subtitles {
        bottom: 80px;
        font-size: 16px;
        max-width: 85%;
        min-height: 50px;
        padding: 12px 20px;
    }
}

@media (min-width: 3840px) {
    #subtitles {
        bottom: 120px;
        font-size: 24px;
        max-width: 70%;
        min-height: 70px;
        padding: 20px 30px;
    }
}

/* 错误模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin-bottom: 16px;
    color: #FF3B30;
}

.modal-content p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.5;
}

/* 思考动画 */
.thinking-animation {
    position: relative;
    overflow: hidden;
}

.thinking-animation::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.3), transparent);
    animation: thinking-shimmer 1.5s infinite;
}

@keyframes thinking-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.notification.show {
    transform: translateX(0);
}

.notification.info {
    background: #4a90e2;
}

.notification.success {
    background: #5cb85c;
}

.notification.warning {
    background: #f0ad4e;
}

.notification.error {
    background: #d9534f;
}

/* 消息动画 */
.message {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.message.show {
    opacity: 1;
    transform: translateY(0);
}

/* 发送按钮状态 */
.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn.active {
    background: #4a90e2;
    transform: scale(1.05);
}

/* 语音按钮录音状态 */
.voice-btn.recording {
    background: #e74c3c;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}



.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h3 {
    margin: 0;
    flex: 1;
}

/* 响应式改进 */
@media (max-width: 768px) {
    .control-panel {
        width: 100%;
        height: 50vh;
        bottom: 0;
        right: 0;
        border-radius: 20px 20px 0 0;
    }
    
    .control-panel.collapsed {
        height: 60px;
    }
    
    .toggle-btn {
        top: 15px;
        right: 15px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* WebXR 按钮样式 */
#VRButton {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 2px solid #007AFF !important;
    color: white !important;
    padding: 12px 24px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

#VRButton:hover {
    background: #007AFF !important;
    transform: scale(1.05) !important;
}

/* 隐藏面板状态 */
#control-panel.collapsed .panel-content {
    display: none;
}

#control-panel.collapsed {
    width: auto;
}

/* 3D 场景容器 */
canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* 环境面板样式 */
.environment-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    z-index: 1000;
    overflow: hidden;
    display: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.environment-panel.visible {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.environment-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.environment-panel .panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.environment-panel .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.environment-panel .close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.environment-panel .panel-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.environment-panel .section {
    margin-bottom: 30px;
}

.environment-panel .section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
}

/* 环境网格 */
.environment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.env-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.env-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.env-card.active {
    background: rgba(0, 123, 255, 0.2);
    border-color: #007bff;
}

.env-preview {
    width: 60px;
    height: 40px;
    margin: 0 auto 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.env-preview.default-env {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.env-preview.gs-env {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
}

.env-preview.realistic-env {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
}

/* 诗人选择器区域 */
#poet-selector-area {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* 诗人下拉选择栏 */
.poet-dropdown-container {
    position: relative;
    margin-bottom: 15px;
}

.poet-dropdown {
    width: 100%;
    padding: 12px 40px 12px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.poet-dropdown:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.poet-dropdown:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.7);
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
    color: #ffffff;
}

.poet-dropdown option {
    background: #2a2a2a;
    color: #ffffff;
    padding: 12px;
    font-weight: 500;
    border: none;
}

.dropdown-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.2s ease;
}

.poet-dropdown:focus + .dropdown-icon {
    transform: translateY(-50%) rotate(180deg);
}

/* 诗人头像显示区域 */
.poet-avatar-display {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.poet-avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: bold;
}

.poet-avatar.liqingzhao {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
}

.poet-avatar.libai {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
}

.poet-avatar.dufu {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.poet-avatar.sushi {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
}

.poet-avatar.taoyuanming {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
}

.poet-name {
    font-size: 12px;
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.poet-dynasty {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* 当前诗人信息 */
.current-poet-info {
    background: rgba(0, 123, 255, 0.15);
    border: 1px solid rgba(0, 123, 255, 0.4);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(5px);
}

.poet-details {
    margin-top: 8px;
}

.current-poet-info .poet-name {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.current-poet-info .poet-dynasty {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.current-poet-info .poet-style {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* 诗人头像颜色样式 */
.poet-avatar-circle.liqingzhao {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
}

.poet-avatar-circle.libai {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
}

.poet-avatar-circle.dufu {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.poet-avatar-circle.sushi {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
}

.poet-avatar-circle.taoyuanming {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
}

/* 角色网格（保持原有样式兼容性） */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.char-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.char-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.char-card.active {
    background: rgba(0, 123, 255, 0.2);
    border-color: #007bff;
}

.char-preview {
    width: 50px;
    height: 50px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
}

.char-preview.liqingzhao-char {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
}

.char-preview.libai-char {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
}

.char-preview.dufu-char {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.char-preview.sushi-char {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
}

.char-preview.taoyuanming-char {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
}

.char-card span {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.char-card small {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

/* 设置网格 */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.setting-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.setting-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.setting-item input[type="range"] {
    flex: 1;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 上传卡片 */
.upload-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.upload-card input[type="file"] {
    display: none;
}



/* 响应式设计 */
@media (max-width: 768px) {
    .environment-panel {
        width: 95vw;
        max-height: 90vh;
    }
    
    .environment-grid,
    .character-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* 移动设备字幕调整 */
@media (max-width: 768px) {
    #subtitles {
        max-width: 90%;
        font-size: 14px;
        padding: 10px 16px;
    }
}